<template>
	<view>
		<zhangguangsen-search :hotList="hotList" :searchList="searchList" @onInput="onInput" @onSearchConfirm="onSearchConfirm"></zhangguangsen-search>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				hotList:['aa','bb','cc','dd','测试一个超产的龙欧索','aa','bb','cc','dd','测试一个超产的龙欧索'],
				searchList:[]
			}
		},
		mounted(){
		},
		methods: {
			onInput(val){
				console.log('**input',val)
				//模拟后端返回数据,根据val调用接口
				setTimeout(()=>{
					 this.searchList = ['aabacd','bb','cc','dd','测试一个超产的龙欧索','aa',Math.random()]//这里模拟 axios 返回的数据
				},2000)
			},
			onSearchConfirm(searchVal){
				console.log('搜索词',searchVal)
			}
		}
	}
</script>

<style lang="scss">
</style>
